home *** CD-ROM | disk | FTP | other *** search
- public class ClassBobbing extends Codex {
- private CodexThing _tracker = new CodexThing(((Codex)this).GetClassThing());
- private CodexThing _bobber;
- private float _minSpeed;
- private float _maxSpeed;
- private float _delay;
- public static String[] _params = new String[]{"Bobbing thing", "Min speed;8", "Max speed;15", "Delay;1"};
-
- public void beginscene(int clientGuid, int captureID) {
- float[] offset = new float[3];
- offset[0] = 0.0F;
- offset[1] = 0.0F;
- offset[2] = 0.0F;
- this._tracker.AttachThing(this._bobber.GetGUID(), -1, offset, 0);
- this._tracker.MoveToFrame(1, (float)((double)this._minSpeed + Math.random() * (double)(this._maxSpeed - this._minSpeed)));
- }
-
- public void arrived(int thingGuid, int frameNum, int captureID) {
- ((Codex)this).SetTimer(frameNum == 0 ? (float)(Math.random() * (double)this._delay) : 0.0F, 0, (float)(frameNum == 0 ? 1 : 0));
- }
-
- public void timer(int timerID, float arg0, float arg1, float arg2, float arg3) {
- this._tracker.MoveToFrame((int)arg0, (float)((double)this._minSpeed + Math.random() * (double)(this._maxSpeed - this._minSpeed)));
- }
-
- public ClassBobbing(CodexThing bobber, float minSpeed, float maxSpeed, float delay) {
- this._bobber = new CodexThing(((Codex)bobber).GetGUID());
- this._minSpeed = minSpeed;
- this._maxSpeed = maxSpeed;
- this._delay = delay;
- }
- }
-